import { createAPI } from '@/utils/request'

/**
 * 用户列表
 * @param {*} data
 * @returns
 */
export const list = data => createAPI('/users/', 'get', data)

/**
 * 获取用户简单列表
 * @param {*} data
 */
export const simple = data => createAPI('/users/simple', 'get', data)

/**
 * 添加用户
 * @param {*} data
 * @returns
 */
export const add = data => createAPI('/users', 'post', data)

/**
 * 更新用户
 * @param {*} data
 * @returns
 */
export const update = data => createAPI(`/users/${data.id}`, 'put', data)

/**
 * 移除用户
 * @param {*} data
 * @returns
 */
export const remove = data => createAPI(`/users/${data.id}`, 'delete', data)

/**
 * 获取用户详情
 * @param {*} data
 * @returns
 */
export const detail = data => createAPI(`/users/${data.id}`, 'get', data)
